home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / progjrn / pj_7_3a.arc / MOUSE.CLS < prev    next >
Text File  |  1989-02-22  |  964b  |  43 lines

  1. // mouse.cls    a C++ Mouse class -- for DOS.
  2. //
  3. // (c) Aspen Scientific 1989. All Rights Reserved.
  4. // Author: Vaughn Vernon
  5.  
  6. #ifndef __MOUSE_CLASS__
  7.  
  8. # define __MOUSE_CLASS__     1
  9.  
  10. # include "point.cls"
  11.  
  12. // Mouse class
  13.  
  14. class Mouse {
  15.  
  16. protected:
  17.     // used by derived class
  18.     int    installed;
  19.     int    numButtons;
  20. public:
  21.  
  22.     Mouse();
  23.     ~Mouse();
  24.  
  25.     // tell user how many buttons the mouse has
  26.     int        buttons() { return numButtons; }
  27.     virtual void    hide();
  28.     virtual void    show();
  29.     virtual int getEvent(Point &,unsigned & b1,unsigned & b2,unsigned & b3);
  30.     virtual void    setPosition(Point &);
  31.     virtual void    flush();
  32.  
  33.     // this method is strictly system dependant.
  34.     // to use this, a class must be derived and the
  35.     // virtual function replace.  the argument points
  36.     // to an implementation dependant struct of some
  37.     // sort which defines the type of mouse-pointer needed.
  38.  
  39.     virtual void makePointer(const void *) { }
  40. };
  41.  
  42. #endif // __MOUSE_CLASS__
  43.